// =============================================================================
//  Spangles Analyzer
//
//  Copyright(c) 2008
//  See LICENSE.txt for licensing information.
// =============================================================================

package com.google.spangles.view.renderers;

import java.util.Properties;

/**
 * (Description)
 * (Any invariants [conditions that are always true] )
 * (Usage instructions, and/or examples)
 * (TODOs, ASSUMPTIONs, etc.)
 * (Known Bugs)
 * (Concurrency strategy - not thread safe or how it's thread safe)
 * 
 * @author Chris
 */
public class GraphicsOptions
{
   int size;

   String white;
   String gray;
   String black;
   
   int bevel;
   
   int contrast;
   
   String board;
   
   int slack;
   
   boolean top;
   boolean bottom;
   boolean left;
   boolean right;
   
   String fontName;
   
   int fontSize;
   
   String fontColor;
   
   String boardGrid;
   
   /**
    * @param props
    */
   public GraphicsOptions(Properties props)
   {
      size = Integer.valueOf(props.getProperty("spangles.tile.size"));
      
      white = props.getProperty("spangles.tile.white");
      gray = props.getProperty("spangles.tile.gray");
      black = props.getProperty("spangles.tile.black");

      bevel = Integer.valueOf(props.getProperty("spangles.tile.bevel"));
      contrast = Integer.valueOf(props.getProperty("spangles.tile.contrast"));

      board = props.getProperty("spangles.board");

      slack = Integer.valueOf(props.getProperty("spangles.board.slack"));
      
      top = (props.getProperty("spangles.board.top").equals("yes"));
      bottom = (props.getProperty("spangles.board.bottom").equals("yes"));
      left = (props.getProperty("spangles.board.left").equals("yes"));
      right = (props.getProperty("spangles.board.right").equals("yes"));
      
      fontName = props.getProperty("spangles.font.name");
      fontSize = Integer.valueOf(props.getProperty("spangles.font.size"));
      fontColor = props.getProperty("spangles.font.color");

      boardGrid = props.getProperty("spangles.board.grid");
   }

   /**
    * @return Returns the size.
    */
   public int getSize()
   {
      return size;
   }

   /**
    * @return Returns the white.
    */
   public String getWhite()
   {
      return white;
   }

   /**
    * @return Returns the gray.
    */
   public String getGray()
   {
      return gray;
   }

   /**
    * @return Returns the black.
    */
   public String getBlack()
   {
      return black;
   }

   /**
    * @return Returns the bevel.
    */
   public int getBevel()
   {
      return bevel;
   }

   /**
    * @return Returns the contrast.
    */
   public int getContrast()
   {
      return contrast;
   }

   /**
    * @return Returns the board.
    */
   public String getBoard()
   {
      return board;
   }

   /**
    * @return Returns the slack.
    */
   public int getSlack()
   {
      return slack;
   }

   /**
    * @return Returns the top.
    */
   public boolean isTop()
   {
      return top;
   }

   /**
    * @return Returns the bottom.
    */
   public boolean isBottom()
   {
      return bottom;
   }

   /**
    * @return Returns the left.
    */
   public boolean isLeft()
   {
      return left;
   }

   /**
    * @return Returns the right.
    */
   public boolean isRight()
   {
      return right;
   }

   /**
    * (Description - what the method does and why)
    * (Visibility decision, if not obvious)
    * (Pre/Post Conditions)
    * (Usage examples)
    * (Algorithmic notes)
    * (Concurrency issues)
    * @return
    */
   public String getFontName()
   {
      return fontName;
   }
   
   public int getFontSize()
   {
      return fontSize;
   }

   /**
    * (Description - what the method does and why)
    * (Visibility decision, if not obvious)
    * (Pre/Post Conditions)
    * (Usage examples)
    * (Algorithmic notes)
    * (Concurrency issues)
    * @return
    */
   public String getFontColor()
   {
      return fontColor;
   }

   /**
    * (Description - what the method does and why)
    * (Visibility decision, if not obvious)
    * (Pre/Post Conditions)
    * (Usage examples)
    * (Algorithmic notes)
    * (Concurrency issues)
    * @return
    */
   public String getBoardGrid()
   {
      return boardGrid;
   }

}
